// Fill out your copyright notice in the Description page of Project Settings.

#pragma once
#include "Item.h"

/**
 *  last modify 2016.6.19 22:00
 */

class ISALONG2_API Bag
{
public:
	Bag(float bagSize);
	~Bag();

private:
	TArray<Item> _data;
	// maybe we need a Interface here
	UObject* _owner=nullptr;
	// bag size
	float _bagSize;
public:
	// the owner pick this up
	void PickUp(UObject* owner);
	// put a item in
	bool PutIn(int id, int count);
	// put in return a guid
	FGuid PutIn_Guid(int id, int count);
	// the return value indicate that whether success or not
	bool TakeOut(int id,int count);
	// take out with guid
	bool TakeOut(FGuid guid, int count);
	// set the addition value
	bool SetAddition(int id, int val);
	// set the addition value use GUID
	bool SetAddition(FGuid guid, int val);
	// use for UI display
	TArray<Item> ReadData();
	// get owner
	UObject* GetOwner();
	// get bag size
	float GetBagSize();
	// get currentContain
	float GetCurrentWeight();
};
